import {
  dictFindAll
} from "@/api/after-sale/dictionary";
export default {
  state: {
    dictionary: [], //字典数据
  },
  mutations: {
    set_dictionary(state, value) {
      state.dictionary = value;
    }
  },
  actions: {
    getDictAll({
      commit
    }, ) {
      dictFindAll().then(res => {
        let _data = res.data ? res.data : [];
        commit('set_dictionary', _data);
        sessionStorage.setItem("dictionary", JSON.stringify(_data));
      })
    },
    writeDictonary({
      commit
    }, value) {
      commit('set_dictionary', value);
    }
  }
}
